package com.framework.tools;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.framework.persist.ORMapper;

public class DBColumnORMapper implements ORMapper{

	public DBColumn mapRow(ResultSet rs, int rowNum) throws SQLException {
		DBColumn column = new DBColumn();
		column.setColumnName(rs.getString("COLUMN_NAME"));
		column.setColumnDef(rs.getString("COLUMN_DEF"));
		column.setColumnSize(rs.getInt("COLUMN_SIZE"));
		column.setColumnType(rs.getInt("DATA_TYPE"));
		column.setDecimalDigits(rs.getInt("DECIMAL_DIGITS"));
		column.setNullable(rs.getInt("NULLABLE") == 1 ? true : false);
		column.setNumPrecRadix(rs.getInt("NUM_PREC_RADIX"));
		column.setComment(rs.getString("REMARKS"));
		return column;
	}

}
